package com.moyou.weichat.mvp.presenter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.moyou.weichat.R;
import com.moyou.weichat.mvp.BasePresenter;
import com.moyou.weichat.mvp.view.ChatVerticalView;

/**
 * Created by Administrator on 2017/10/17 0017.
 * sj : 2017年10月17日14:40:01
 * name : ts
 * 用途：聊天的列表的控制器
 */

public class ChatVerticalPresenter extends BasePresenter<ChatVerticalView> {

    private TextView itemSig; //验证消息的内容
    private  TextView itemTimer; //获取到验证消息进行更新时间

    public ChatVerticalPresenter(ChatVerticalView view) {
        super(view);
    }

    //聊天添加HeaderView
    public View initHeaderView(Context context,int layoutId) {
        View view  = View.inflate(context,layoutId,null);
        ImageView chatOval = (ImageView) view.findViewById(R.id.chat_item_oval);
        ImageView chatRadius = (ImageView) view.findViewById(R.id.chat_item_radius);
        TextView itemName = (TextView) view.findViewById(R.id.item_message_name);
        itemSig = (TextView) view.findViewById(R.id.item_message_sig);
        itemTimer = (TextView) view.findViewById(R.id.item_message_timer);
        chatRadius.setImageResource(R.mipmap.ic_verify);
        itemName.setText("验证消息");
        itemSig.setText("暂无验证消息");
        itemTimer.setText("02:33");
        chatRadius.setVisibility(View.VISIBLE);
        chatOval.setVisibility(View.GONE);
        return view;
    }

    //设置内容需要的时候进行更新
    public void setVerificationTextContent(String content ){
        itemSig.setText(content);
        itemTimer.setText("");
    }


}
